package file;

import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Stream;

/**
 * @author jukg
 * @date 2023/08/17 18:00
 * @description
 */
public class Filestest {

    public static void main(String[] args) {
        try(Stream<String> lines = Files.lines(Paths.get("C:\\Users\\Administrator\\Desktop\\aaa.txt"))){
            final Integer[] count = {0};
            lines.forEach(line ->{
                if(count[0] ==0){
                    System.out.println("shouhang:" + line);
                }else {
                    System.out.println("fei shouhang:" + line);
                }
                count[0]++;
            });


        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
